package BaseUserController

import (
	"github.com/gin-gonic/gin"
	"learn/app/controllers/cc"
	"learn/app/services/baseUserService"
)

type RoleMenu struct {
	cc.BaseController
	Id       int64  `json:"id" one:"gte=0"`
	MenusIds string `json:"menu_ids"`
}

func (obj *RoleMenu) Update(c *gin.Context) {
	userStruct := RoleMenu{}
	if ok := cc.BindParamAndCheckAndExpectField(c, &userStruct); ok == false {
		return
	}

	res, _ := new(baseUserService.UserRole).Update(obj.ToMap(userStruct))
	cc.Return_with_code(res, c)
}
